// run: $exec > input
#include <iostream>
#include <ctime>
#include <cstdlib>

int main()
{
	std::srand(std::time(0));
	int n = 100000 / 2, upper = 20;
	std::cout << "1\n" << n << '\n';
	for (int i = 1 ; i < n; i++)
		std::cout << i << " " << i + 1 << " " << rand() % 2 + 1 << "\n";
	std::cout << "1\n1\n";
}

